package com.happyhell.hiyou.struts2.actions;

import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;

import com.happyhell.hiyou.model.UserInfo;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
 
public class LoginAction extends ActionSupport implements SessionAware, ModelDriven<UserInfo>{
 
    private static final long serialVersionUID = -3369875299120377549L;
 
    @Override
    public String execute(){
        System.out.println("inside execute");
        sessionAttributes.put("USER", user);
        return INPUT;
    }
     
    private UserInfo user = new UserInfo();
    private Map<String, Object> sessionAttributes = null;
 
    @Override
    public void setSession(Map<String, Object> sessionAttributes) {
        this.sessionAttributes = sessionAttributes;
    }
     
    @Override
    public UserInfo getModel() {
        return user;
    }
     
} 
